
export default class BoundingSphere {
    center = null;
    radius = 0;

    constructor(center, radius) {
        this.center = center;
        this.radius = radius;
    }

    isInView(camera) {
        const distanceSquared = this.center.sub(camera.position).lengthSquared();
        const cameraFarPlane = 1000.0; // 假设相机的远剪裁面
        const radiusSquared = this.radius * this.radius;

        return distanceSquared < (camera.position.z + cameraFarPlane) * (camera.position.z + cameraFarPlane) + radiusSquared;
    }
}